Add support to cdylib, dylib and staticlib#2039
Add support to cdylib, dylib and staticlib#2039celinval merged 5 commits intomodel-checking:mainfrom
Conversation
kani-driver/src/call_cargo.rs
Outdated
There was a problem hiding this comment.
What happens in the case of (false, true)?
There was a problem hiding this comment.
For (false, true), if verbose, we will print that the current target was skipped due to unsupported type. Otherwise, we will silently ignore the target.
There was a problem hiding this comment.
Note that the behavior hasn't changed here and it is still covered by this test: https://github.com/model-checking/kani/tree/main/tests/cargo-ui/unsupported-lib-types/proc-macro
There was a problem hiding this comment.
In my todo list I have a link to https://github.com/rust-lang/rust/pull/97485/files
I haven't spent the time looking, but while you're here, it looked like maybe there was now a reusable archive.rs in codegen_ssa, I was hoping we could delete this file. Got a chance to look?
There was a problem hiding this comment.
We don't have access to this yet, since we are still using an older version of rustc. But once we do update to a newer version, I agree that we should be able to completely remove this file and just use ArArchiveBuilder directly.
Refactor how we were creating the `rlib` files in the link stage. We cannot invoke rustc's linker directly for the native types since they will call the native linker that will fail. Instead, we just manually create an `rlib` file that includes only a `metadata` file. I cleaned up our archive builder since we no longer need to conform to rustc's interface.
One library target can have multiple crate-types, but they should only be aggregated in one compilation target.
4f50a45 to
572d330
Compare
Description of changes:
Refactor how we were creating the
rlibfiles in the link stage. We cannot invoke rustc's linker directly for the native types since they will call the native linker that will fail. Instead, we just manually create anrlibfile that includes only ametadatafile.I cleaned up our archive builder since we no longer need to conform to rustc's interface.
Resolved issues:
Resolves #1915
Related RFC:
Call-outs:
Testing:
How is this change tested? Modified tests
Is this a refactor change? Kinda
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.